<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>jQuery File Upload Example</title>
</head>
<body>
<div class="yf_img">
<input class="fileupload" type="file" name="files[]" data-url="index.php?g=home&m=index&a=act_upload" multiple>
<img src="" style="display:none;">
</div>
<div class="yf_img">
<input class="fileupload" type="file" name="files[]" data-url="index.php?g=home&m=index&a=act_upload" multiple>
<img src="" style="display:none;">
</div>
<div class="yf_img">
<input class="fileupload" type="file" name="files[]" data-url="index.php?g=home&m=index&a=act_upload" multiple>
<img src="" style="display:none;">
</div>
<a class="yf-add">add</a>
<script src="{$_C.hy_path}js/jquery-1.11.2.min.js"></script>
<script src="{$_C.hy_path}js/jquery.ui.widget.js"></script>
<script src="{$_C.hy_path}js/jquery.iframe-transport.js"></script>
<script src="{$_C.hy_path}js/jquery.fileupload.js"></script>
<script>
$(function () {
	function yf_start()
	{
	   $('.fileupload').fileupload({
	    	dataType: 'json',
	        add: function (e, data) {
	            data.context = $('<p/>').text('Uploading...').appendTo(document.body);
	            data.submit();
	        },
	        done: function (e, data) {
	           $(this).parent().find('img').attr('src', data.result.url).css('display', 'block');
	           data.context.html = "";
	           console.log(data);
	        }
	    });
	}
    $('.yf-add').click(function(){
    	var html = '<div class="yf_img"><input class="fileupload" type="file" name="files[]" data-url="index.php?g=home&m=index&a=act_upload" multiple><img src="" style="display:none;"></div>';
    	$(html).appendTo('body');
    	yf_start()
    });
    yf_start();
});
</script>
</body> 
</html>